﻿using Furion.DatabaseAccessor;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using YFurion.Locators;

namespace YFurion.Entities
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
    public interface IYEntityOfTKey<TKey> : IYEntityOfTKey<TKey, MasterDbContextLocator, SlaveDbContextLocator>
    {
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
    /// <typeparam name="TDbContextLocator1"></typeparam>
    public interface IYEntityOfTKey<TKey, TDbContextLocator1> : IYEntityBase<TKey>
        where TDbContextLocator1 : class, IDbContextLocator
    {
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
    /// <typeparam name="TDbContextLocator1"></typeparam>
    /// <typeparam name="TDbContextLocator2"></typeparam>
    public interface IYEntityOfTKey<TKey, TDbContextLocator1, TDbContextLocator2> : IYEntityBase<TKey>
        where TDbContextLocator1 : class, IDbContextLocator
        where TDbContextLocator2 : class, IDbContextLocator
    {
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
    /// <typeparam name="TDbContextLocator1"></typeparam>
    /// <typeparam name="TDbContextLocator2"></typeparam>
    /// <typeparam name="TDbContextLocator3"></typeparam>
    public interface IYEntityOfTKey<TKey, TDbContextLocator1, TDbContextLocator2, TDbContextLocator3> : IYEntityBase<TKey>
        where TDbContextLocator1 : class, IDbContextLocator
        where TDbContextLocator2 : class, IDbContextLocator
        where TDbContextLocator3 : class, IDbContextLocator
    {
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
    public interface IYEntityBase<TKey> : IPrivateEntity
    {
        /// <summary>
        /// Unique identifier for this entity.
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        TKey Id { get; set; }
    }
}
